<!DOCTYPE html>
<html lang="en">
	<head>
		<title>50bus管理后台</title>
		<meta charset="UTF-8" />
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="/resources/admin/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/resources/admin/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="/resources/admin/css/uniform.css" />
		<link rel="stylesheet" href="/resources/admin/css/select2.css" />		
		<link rel="stylesheet" href="/resources/admin/css/unicorn.main.css" />
		<link rel="stylesheet" href="/resources/admin/css/unicorn.grey.css" class="skin-color" />
		<link rel="stylesheet" href="/resources/admin/css/style.css" />
		<link rel="stylesheet" href="/resources/kindeditor/themes/default/default.css" />
	</head>
	<body>
		<div id="header">
			<h1>渲染提供商</h1>		
		</div>
		<div id="user-nav" class="navbar navbar-inverse">
            <ul class="nav">
                <li class="btn btn-inverse"><a href="/admin/logout.html"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
            </ul>
        </div>
		<div id="sidebar">
			<ul>
				<li><a href="/admin/user_list.html"><i class="icon icon-user"></i> <span>用户管理</span></a></li>
				<li><a href="/admin/recharge_list.html"><i class="icon icon-user"></i> <span>用户充值</span></a></li>
				<li><a href="/admin/user_cash.html"><i class="icon icon-leaf"></i> <span>提现管理</span></a></li>
				<li  class="submenu">
					<a href=""><i class="icon icon-leaf"></i> <span>创意管理</span></a>
					<ul>
						<li><a href="/admin/creative_check.html" target="i_iframe">创意审核</a></li>
						<li><a href="/admin/creative_helper_list.html" target="i_iframe">创意助手</a></li>
					</ul>
				</li>
				<li  class="submenu">
					<a href=""><i class="icon icon-leaf"></i> <span>剧本管理</span></a>
					<ul>
						<li><a href="/admin/script_check.html" target="i_iframe">剧本审核</a></li>
						<li><a href="/admin/attribute_check.html" target="i_iframe">投稿审核</a></li>
						<li><a href="/admin/sptbanner/list.html" target="i_iframe">剧本焦点图</a></li>
						<li><a href="/admin/script_automatic_remit.html" target="i_iframe">剧本打款记录</a></li>
					</ul>
				</li>
				<li class="submenu active open">
					<a href=""><i class="icon icon-leaf"></i> <span>渲染管理</span></a>
					<ul>
						<li><a href="/admin/render_banner/render_banner_list.html" target="i_iframe">渲染焦点图</a></li>
						<li><a href="/admin/render_provider_list.html" target="i_iframe">渲染提供商</a></li>
					</ul>
				</li>
			</ul>
		</div>
		<div id="style-switcher">
			<i class="icon-arrow-left icon-white"></i>
			<span>风格:</span>
			<a href="#grey" style="background-color: #555555;border-color: #aaaaaa;"></a>
			<a href="#blue" style="background-color: #2D2F57;"></a>
			<a href="#red" style="background-color: #673232;"></a>
		</div>
		<div id="content">
			<div id="content-header">
				<h1>渲染提供商</h1>
			</div>
			<div id="breadcrumb">
				<a href="/admin/index.html" title="返回首页" class="tip-bottom"><i class="icon-home"></i> 首页</a>
				<a href="#" class="current">渲染提供商</a>
			</div>
			<div class="container-fluid">
				<div class="row-fluid">
					<div class="span12">
						<div class="widget-box">
							<div class="widget-title">
								<span class="icon">
									<i class="icon-align-justify"></i>									
								</span>
								<h5>添加</h5>
							</div>
							<div class="widget-content nopadding">
								<form class="form-horizontal" method="post" id="myForm" action="/admin/render/provider_add.json" >
                                    <div class="control-group">
                                        <label class="control-label">LOGO：</label>
                                        <div class="controls">
	                                        <div class="upload-box">
	                                        	<div class="banner-bbox" style="width:200px;">
                                    				<img style="width:200px;" src="http://placehold.it/164x122" />
	                                    		</div>
	                                    		<input type="hidden" name="logo" id="logo" required="true" />
	                                    		<div class="upload-btn">
	                                    			<button type="button" class="btn" id="imgButton">图片上传</button>
	                                    		</div>
	                                        </div>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">公司：</label>
                                        <div class="controls">
	                                        <input type="text" name="comp" style="width:240px;" required="true" />
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">联系电话：</label>
                                        <div class="controls">
	                                         <input type="text" name="tele" style="width:240px;" required="true" number="true"/>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">描述：</label>
                                        <div class="controls">
	                                        <textarea type="text" name="rpdescribe" style="width:540px;height:200px;" required="true"></textarea>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">集群：</label>
                                        <div class="controls">
                                        	<input type="text" name="colony" style="width:240px;" required="true" />
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">性能：</label>
                                        <div class="controls">
                                        	<p><input type="text" name="performance" style="width:240px;" required="true" placeholder="请输入'优秀'，'良好'或'一般'" /></p>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">单价：</label>
                                        <div class="controls">
	                                        <p><input type="text" name="unit_price" style="width:240px;" required="true" number="true" placeholder="请输入正数" /> (元/核/小时)</p>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">繁忙程度：</label>
                                        <div class="controls">
	                                        <p><input type="text"  name="busy" style="width:240px;" required="true" placeholder="请输入'繁忙'或'一般'" /><p>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">计算能力：</label>
                                        <div class="controls">
	                                        <p><input type="text" name="computer_power" style="width:240px;" required="true" number="true" placeholder="请输入整数" /> (总核数)</p>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">地点：</label>
                                        <div class="controls">
	                                        <p><input type="text" name="locale" style="width:240px;" required="true" placeholder="多个城市用、号隔开" /></p>
                                        </div>
                                    </div>
                                    <div class="control-group">
                                        <label class="control-label">外部渲染链接：</label>
                                        <div class="controls">
	                                        <p><input type="text" name="service_url" style="width:240px;" required="true" /></p>
                                        </div>
                                    </div>
                                    <div class="form-actions">
                                        <input type="submit" value="保存" id="submitBtn" class="btn btn-success" />
                                        <input type="button" value="取消" class="btn btn-danger" onclick="history.go(-1);"/>
                                    </div>
                                </form>
							</div>
						</div>
					</div>
				</div>
				<div class="row-fluid">
					<div id="footer" class="span12">
						版权所有 2014 50bus Corporation. 保留一切权利
					</div>
				</div>
			</div>
		</div>

		<script src="/resources/admin/js/jquery.min.js"></script>
		<script src="/resources/admin/js/jquery.ui.custom.js"></script>
		<script src="/resources/admin/js/bootstrap.min.js"></script>
		<script src="/resources/admin/js/jquery.uniform.js"></script>
		<script src="/resources/admin/js/select2.min.js"></script>
		<script src="/resources/admin/js/jquery.dataTables.min.js"></script>
		<script src="/resources/admin/js/unicorn.js"></script>
		<script src="/resources/admin/js/unicorn.tables.js"></script>
		<script src="/resources/kindeditor/kindeditor.js"></script>
		<script src="/resources/kindeditor/lang/zh_CN.js"></script>
		<script type="text/javascript" src="/resources/js/jquery.form.js"></script>
		<script type="text/javascript" src="/resources/js/jquery.validate.js"></script>
		<script type="text/javascript">
		$(function(){	
			$("#myForm").validate({
				errorPlacement:function(error,element) {
				},
				errorClass: "error",
				submitHandler:function(form){
					formSubmit($("#myForm"));
				}
			});
			function formSubmit(form){
			    form.ajaxSubmit({
			        dataType: "json",              
			        success: function(json)             
			        {
			        	location.href="/admin/render_provider_list.html";
			        }
			    });
    		}
    		
			var editor = KindEditor.editor({
			allowFileManager : true
		});
		
		$('#imgButton').click(function() {
			editor.loadPlugin('image', function() {
				editor.plugin.imageDialog({
					showRemote : false,
					imageUrl : $("#logo").val(),
					clickFn : function(url, title, width, height, border, align) {
						$(".banner-bbox img").attr('src',url);
						$("#logo").val(url);
						editor.hideDialog();
					}
				});
			});
		});
			
		});
		</script>
	</body>
</html>